package course8.com.youkeda.service.impl;

import course8.com.youkeda.model.Classes;
import course8.com.youkeda.service.ClassesService;

import java.util.ArrayList;
import java.util.List;

public class ClassesServiceImpl implements ClassesService {
    private static List<Classes> CLASSES=new ArrayList<>();
    static {
        Classes c1=new Classes();
        c1.setId("c_100");
        c1.setName("计算机");
        c1.setStartYear(18);
        CLASSES.add(c1);
        Classes  c2=new Classes();
        c2.setId("c_200");
        c2.setName("计算机");
        c2.setStartYear(19);
        CLASSES.add(c2);
    }

    @Override
    public void add(Classes classes) {
        CLASSES.add(classes);
    }

    @Override
    public List<Classes> getAll() {

        return CLASSES;
    }
}
